/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.groupb.circus.impl_interfaces;

import com.groupb.circus.interfaces.Thumbnail;
import java.awt.Graphics;
import java.awt.Image;
import java.io.Serializable;
import javax.swing.ImageIcon;

/**
 *
 * @author a
 */
public class ThumbnailImp implements Thumbnail, Serializable{

    /*
     * Para mostrar iconos grandes de nuestras propias fotos
     */
    ImageIcon photo = null;
    ImageIcon Scale = null;
    
    ImageIcon photo2 = null;
    ImageIcon PhotoBig = null;
    
    
    
    /*
     * Estas dos variables se usan para mostrar iconos pequeños de las imagenes de busqueda
     */
    ImageIcon photo3 = null;
    ImageIcon PhotoSmall =null;
    
    public ThumbnailImp(){}
    

    
    @Override
    public void setImage(String path) {
  
           photo = new ImageIcon(path);
           Image image = photo.getImage();
           Scale = new ImageIcon(image.getScaledInstance(100, 100, Image.SCALE_DEFAULT));
          
           
     
    }

    @Override
    public ImageIcon getImage() {

        return Scale;
    }
  
    @Override
    public void setImageBig(String path){
        photo2 = new ImageIcon(path);
        Image image2 = photo2.getImage();
        PhotoBig = new ImageIcon(image2.getScaledInstance(120, 120, Image.SCALE_DEFAULT));
    }
    
    @Override
    public ImageIcon getImageBig(){

        return PhotoBig;
    }

    
    @Override
    public void setImageSmall( String path){
        photo3 = new ImageIcon(path);
        Image image3 = photo3.getImage();
        PhotoSmall = new ImageIcon(image3.getScaledInstance(45, 45, Image.SCALE_DEFAULT));
    }
    
    @Override
     public ImageIcon getImageSmall(){

        return PhotoSmall;
    }
    
    
}
